package dev.alm.cqtakeoutservice.common;

import lombok.Data;

import java.io.Serializable;

@Data
public class CR implements Serializable {

    private static final long serialVersionUID = 1L;

    private Integer code;
    private String message;
    private Object data;

    public static CR ok(Object data) {
        CR cr = new CR();
        cr.setCode(200);
        cr.setMessage("success");
        cr.setData(data);
        return cr;
    }

    public static CR fail(String msg) {
        CR cr = new CR();
        cr.setCode(500);
        cr.setMessage(msg);
        return cr;
    }

}
